/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wwcontrolserver;

import wwcontrolserver.sensor.AbstractSensor;
import java.io.Serializable;
import java.util.ArrayList;
import wwcontrolserver.controls.AbstractControlState;
import wwcontrolserver.ifk.AbstractIFK;

/**
 *
 * @author Michael Ferry
 */
public final class WWControlServerState implements Serializable {
    //Client and Server flags
     public enum StateFlags {CLOSE_CONNECTION,SHUTDOWN_SERVER,CONTROL_UPDATE,
        GET_SERVER_STATUS,SERVER_STATUS,CALGROUP_SENSORS
    }

    private static final long serialVersionUID = 3857961410091156303L;
    public ArrayList<Boolean> ifksAttached = null;
    
    public final ArrayList<AbstractControlState> StateOfControls;
     
    //public static String [] SensorValueNameString = new String[WWControlServer.WWCSValues.length];
    public ArrayList<AbstractSensor> SensorsInSelectedCalGroup;
    public boolean CalibrationState;
    public int SensorCalNumber;
    
    public StateFlags MessageFlag;
    public long MessageID;
    
    //Random generator; 
    
    public WWControlServerState(){
        this.StateOfControls = null;

        this.SetMessageID();
    }
    public WWControlServerState(StateFlags STATE){
        this.StateOfControls = null;
        MessageFlag = STATE;
        this.SetMessageID();
    }

    public WWControlServerState(AbstractControlState Clist){
        this.StateOfControls = new ArrayList<AbstractControlState>();
        this.StateOfControls.add(Clist);
        this.MessageFlag = StateFlags.CONTROL_UPDATE;
    }
    public WWControlServerState(ArrayList<AbstractControlState> Clist, ArrayList<Boolean> ifksAttached){
        this.StateOfControls = Clist;
        this.ifksAttached = ifksAttached;
        this.MessageFlag = StateFlags.SERVER_STATUS;
        //ifksAttached = new boolean [IFKarray.size()];
        
    }
    private void SetMessageID(){
        MessageID = System.currentTimeMillis();
    }
    private void SetMessageID(long ID){
        MessageID = ID;
    }

}
